gtkfilechooserentry: Use accessor functions to access GtkEntry
authorJavier Jardón <jjardon@gnome.org>
Wed, 20 Oct 2010 16:37:59 +0000 (18:37 +0200)
committerJavier Jardón <jjardon@gnome.org>
Tue, 26 Oct 2010 04:07:43 +0000 (06:07 +0200)
gtk/gtkfilechooserentry.c

index 3e5420a947ebf86e6f7a53df0d3c6557d9be3bb9..009d842f37c7424e060f7b67277f2509ae829323 100644 (file)
@@ -998,13 +998,16 @@ get_entry_cursor_x (GtkFileChooserEntry *chooser_entry,
   gint layout_x, layout_y;
   gint layout_index;
   PangoRectangle strong_pos;
+  gint start_pos, end_pos;
 
   layout = gtk_entry_get_layout (GTK_ENTRY (chooser_entry));
 
   gtk_entry_get_layout_offsets (GTK_ENTRY (chooser_entry), &layout_x, &layout_y);
 
+  gtk_editable_get_selection_bounds (GTK_EDITABLE (chooser_entry), &start_pos, &end_pos);
   layout_index = gtk_entry_text_index_to_layout_index (GTK_ENTRY (chooser_entry),
-                                                      GTK_ENTRY (chooser_entry)->current_pos);
+                                                       end_pos);
+
 
   pango_layout_get_cursor_pos (layout, layout_index, &strong_pos, NULL);